const TokenKey = "token";
const LoginType = "loginType";
const AuthLevel = "authLevel";
const OrgId = "orgId";

export function getToken() {
  return localStorage.getItem(TokenKey);
}

export function setToken(token, loginType) {
  localStorage.setItem(LoginType, loginType);
  return localStorage.setItem(TokenKey, token);
}

export function removeToken() {
  localStorage.removeItem(LoginType);
  localStorage.removeItem(TokenKey);
  localStorage.removeItem(AuthLevel);
  localStorage.removeItem(OrgId);
  return localStorage.removeItem(TokenKey);
}
export function setLoginType(loginType) {
  return localStorage.setItem(LoginType, loginType);
}

export function getLoginType() {
  return localStorage.getItem(LoginType);
}

export function setAuthLevel(level) {
  return localStorage.setItem(AuthLevel, level);
}

export function getAuthLevel() {
  return localStorage.getItem(AuthLevel);
}

export function setOrgId(orgId) {
  return localStorage.setItem(OrgId, orgId);
}

export function getOrgId() {
  return localStorage.getItem(OrgId);
}
